package com.neusmart.tongrentang.model;

import com.neusmart.tongrentang.constants.Gender;

/**
 * Created by keven on 2016/8/15.
 */
public class User {
    //
    private String phoneNum;//
    //
    private String idNum;//
    //
    private long userId;//
    //
    private int userRole;//
    //
    private String userName;//
    //
    private int level;//
    //
    private String levelName;//
    //
    private String thirdPartyId;//
    //
    private String thirdPartyIdName;//
    //
    private String pushClientId;//
    //
    private int appOwnerId;//
    //
    private String name;//
    //
    private String birthday;//
    //
    private String avatar;//
    //
    private String avatarFileUploadId;//
    //
    private boolean isActive;//
    //
    private int userType;
    //
    private int gender;//
    //
    private String email;//
    //
    private String countryName;//
    //
    private String provinceName;//
    //
    private String cityName;//
    //
    private long exclusiveClubId;//
    //
    private long memberNum;//
    //
    private boolean isFriend;
    //
    private String token;
    //
    private boolean isLogin;

    public String getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public String getIdNum() {
        return idNum;
    }

    public void setIdNum(String idNum) {
        this.idNum = idNum;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getUserRole() {
        return userRole;
    }

    public void setUserRole(int userRole) {
        this.userRole = userRole;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getLevelName() {
        return levelName;
    }

    public void setLevelName(String levelName) {
        this.levelName = levelName;
    }

    public String getThirdPartyId() {
        return thirdPartyId;
    }

    public void setThirdPartyId(String thirdPartyId) {
        this.thirdPartyId = thirdPartyId;
    }

    public String getThirdPartyIdName() {
        return thirdPartyIdName;
    }

    public void setThirdPartyIdName(String thirdPartyIdName) {
        this.thirdPartyIdName = thirdPartyIdName;
    }

    public String getPushClientId() {
        return pushClientId;
    }

    public void setPushClientId(String pushClientId) {
        this.pushClientId = pushClientId;
    }

    public int getAppOwnerId() {
        return appOwnerId;
    }

    public void setAppOwnerId(int appOwnerId) {
        this.appOwnerId = appOwnerId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAvatarFileUploadId() {
        return avatarFileUploadId;
    }

    public void setAvatarFileUploadId(String avatarFileUploadId) {
        this.avatarFileUploadId = avatarFileUploadId;
    }

    public boolean isActive() {
        return isActive;
    }

    public void setIsActive(boolean isActive) {
        this.isActive = isActive;
    }

    public int getUserType() {
        return userType;
    }

    public void setUserType(int userType) {
        this.userType = userType;
    }

    public int getGender() {
        return gender;
    }

    public String getGenderTxt() {
        return Gender.getNameByValue(gender);
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCountryName() {
        return countryName;
    }

    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public long getExclusiveClubId() {
        return exclusiveClubId;
    }

    public void setExclusiveClubId(long exclusiveClubId) {
        this.exclusiveClubId = exclusiveClubId;
    }

    public long getMemberNum() {
        return memberNum;
    }

    public void setMemberNum(long memberNum) {
        this.memberNum = memberNum;
    }

    public boolean isFriend() {
        return isFriend;
    }

    public void setIsFriend(boolean isFriend) {
        this.isFriend = isFriend;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public boolean isLogin() {
        return isLogin;
    }

    public void setIsLogin(boolean isLogin) {
        this.isLogin = isLogin;
    }

    public String getRegionTxt() {
        return provinceName + (provinceName.equals(cityName) ? "" : " " + cityName);
    }

    public void update(User user) {
        setPhoneNum(user.getPhoneNum());
        setIdNum(user.getIdNum());
        setUserId(user.getUserId());
        setUserRole(user.getUserRole());
        setUserName(user.getUserName());
        setLevel(user.getLevel());
        setLevelName(user.getLevelName());
        setThirdPartyId(user.getThirdPartyId());
        setThirdPartyIdName(user.getThirdPartyIdName());
        setPushClientId(user.getPushClientId());
        setAppOwnerId(user.getAppOwnerId());
        setName(user.getName());
        setBirthday(user.getBirthday());
        setAvatar(user.getAvatar());
        setAvatarFileUploadId(user.getAvatarFileUploadId());
        setIsActive(user.isActive());
        setUserType(user.getUserType());
        setGender(user.getGender());
        setEmail(user.getEmail());
        setCountryName(user.getCountryName());
        setProvinceName(user.getProvinceName());
        setCityName(user.getCityName());
        setExclusiveClubId(user.getExclusiveClubId());
        setMemberNum(user.getMemberNum());
        setToken(user.getToken());
        setIsLogin(user.isLogin());
    }
}
